package com.cetc.ga.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

/**
 * 引入外部配置文件core.properties
 */
@Configuration
//@Component
//@ConfigurationProperties(prefix = "spring.datasource")
@PropertySource("classpath:core.properties")
public class ConfigBean {
    /**
     * application.properties
     */

    @Value("${spring.profiles.active}")
    private String active;

    /**
     * application-*.properties
     */
    @Value("${environment.name}")
    private String envName;  // 环境名
    @Value("${mysql.ip}")
    private String ip;  // ip地址
    @Value("${mysql.port}")
    private String port; // 端口号
    @Value("${mysql.user}")
    private String user; //MySQL用户名
    @Value("${mysql.password}")
    private String password; //MySQL密码
    @Value("${mysql.database}")
    private String database; //MySQL数据库

    /**
     * core.properties
     */

    @Value("${spring.datasource.url}")
    private String mysqlUrl;  //MySQL url
    @Value("${spring.datasource.username}")
    private String mysqlUsername; //MySQL用户名
    @Value("${spring.datasource.password}")
    private String mysqlPassword; //MySQL密码
    @Value("${spring.datasource.driver-class-name}")
    private String mysqlDriver; // //MySQL driver

    public String getActive() {
        return active;
    }

    public void setActive(String active) {
        this.active = active;
    }

    public String getEnvName() {
        return envName;
    }

    public void setEnvName(String envName) {
        this.envName = envName;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getPort() {
        return port;
    }

    public void setPort(String port) {
        this.port = port;
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getDatabase() {
        return database;
    }

    public void setDatabase(String database) {
        this.database = database;
    }

    public String getMysqlUrl() {
        return mysqlUrl;
    }

    public void setMysqlUrl(String mysqlUrl) {
        this.mysqlUrl = mysqlUrl;
    }

    public String getMysqlUsername() {
        return mysqlUsername;
    }

    public void setMysqlUsername(String mysqlUsername) {
        this.mysqlUsername = mysqlUsername;
    }

    public String getMysqlPassword() {
        return mysqlPassword;
    }

    public void setMysqlPassword(String mysqlPassword) {
        this.mysqlPassword = mysqlPassword;
    }

    public String getMysqlDriver() {
        return mysqlDriver;
    }

    public void setMysqlDriver(String mysqlDriver) {
        this.mysqlDriver = mysqlDriver;
    }
}
